package com.ruoyi.system.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ruoyi.system.domain.InformationRecord;
import com.ruoyi.system.domain.dto.InformationDto;
import com.ruoyi.system.domain.vo.InformationVo;
import com.ruoyi.system.mapper.InformationMapper;
import com.ruoyi.system.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class InformationServiceImpl implements InformationService {
    @Autowired
    InformationMapper informationMapper;


    @Override
    public Map informationList(InformationDto informationDto) {
        PageHelper.startPage(informationDto.getPageNum(),informationDto.getPageSize());
        Page<InformationVo> page= informationMapper.informationList(informationDto);
        HashMap<String,Object> map= new HashMap<>();
        map.put("data",page.getResult());
        map.put("total",page.getTotal());
        return map;
    }
}
